<%--
  Created by IntelliJ IDEA.
  User: 南苼
  Date: 2021/7/2
  Time: 14:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="../js/jquery-1.10.2.js" ></script>
    <link rel='stylesheet' href='../css/settings.css'>
    <script>
        $(function(){
            var rl=getUrlParam("URL");
            setUrl(rl);
            lj(rl);
            $(".xk").click(function(){
                var url=$(this).attr("url");
                lj(url);
                $("div").removeClass("xkcss");
                $(this).addClass("xkcss");
            })
            $(".fb").click(function(){
                var z=$(".zf").html();
                var zf=localStorage.getItem("zf");
                var con=localStorage.getItem("con");
                if(z==zf&con>1){
                    localStorage.removeItem("name");
                    localStorage.removeItem("zf");
                    localStorage.removeItem("con");
                    $.ajax({
                        url:"http://localhost:9090/Eventstar/set/up",
                        data:{"i":1},
                        success:function(){
                            window.location.href ="http://localhost:9090/Eventstar/set/getsj"
                        }
                    })
                }else{
                    alert("分数于总分不匹配");
                }
            })
        })
        function lj(z){
            $.ajax({
                url:"http://localhost:9090/Eventstar/"+z,
                success:function(obj){
                    $("#sdv").html(obj);
                }
            })
        }
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }
        function setUrl(url){
            $(".xk").removeClass("xkcss");
            var list=$(".xk");
            for(var i=0;i<list.length;i++){
                if($(list[i]).attr("url")==url){
                    $(list[i]).addClass("xkcss");
                }
            }
        }
    </script>
</head>
<body>
<div class="sd1"></div>
<div class="sd2">
    <div class="sd3">
        <img src="/Eventstar/img/examimg/slog.PNG" class="im">
        <div class="ss">
            <input type="text" class="tx" placeholder="请输入关键词或考试码" />
            <input type="submit" value="搜索"  class="tx1"/>
        </div>
    </div>
    <div class="sd4">
        <input type="hidden" class="h1" value="${URL}"></input>
        <div class="xk" url="settings_zw/settingsks.jsp">考试基本信息</div>
        <div class="xk" url="settings_zw/edit.jsp">试卷编写</div>
        <div class="yl">预览</div>
        <div class="fb">发布</div>
    </div>
</div>
<hr/>
<div id="sdv">

</div>
</body>
</html>
